/**
 * 
 */
package server;

/**
 * @author shlomi
 *
 */
public class ServerReminderBot extends Thread {
private final int minuteInMilliSec = 60000;
	
	/**
	 * Server Handler Reference
	 */
	private ServerHandler srvhnd;
	
	public ServerReminderBot(ServerHandler srvhnd) {
		this.srvhnd = srvhnd;
	}
	
	public void run(){
		while(true){
			// System.out.println("Generating Reminders List...\n");
			//TODO: Re-enable reminders generetor
			srvhnd.generateReminders();
			srvhnd.generateExcptions();
			
			// put thread to sleep for 1 day
			try {
				sleep(minuteInMilliSec*1440);
			} catch (InterruptedException e) {
				e.printStackTrace();
			}
		}
	}
}
